Q1. Plot a histogram, 10, 13, 18, 22, 27, 32, 38, 40, 45, 51, 56, 57, 88, 90, 92, 94, 99
import plotly.express as px
import numpy as np
x = [10, 13, 18, 22, 27, 32, 38, 40, 45, 51, 56, 57, 88, 90, 92, 94, 99]
fig = px.histogram(x= x,nbins=10)
fig.show()
Q2 In a quant test of the CAT Exam, the population standard deviation is known to be 100. A sample of 25 tests taken has a mean of 520. Construct an 80% CI about the mean.
sd = 100 #population standard deviation
n = 25 #sample size
x = 520 #sample mean
a = 0.2 #alpha
z = 1.28
lower_limit = x - z*(sd/np.sqrt(n))
print("lower limit= ",lower_limit)
upper_limit = x + z*(sd/np.sqrt(n))
print("upper limit= ",upper_limit)
print("the 80% CI about mean is: {0} to {1}".format(lower_limit,upper_limit))
lower limit= 494.4 upper limit= 545.6 the 80% CI about mean is: 494.4 to 545.6
Q3. A car believes that the percentage of citizens in city ABC that owns a vehicle is 60% or less. A sales manager disagrees with this. He conducted a hypothesis testing surveying 250 residents & found that 170 residents responded yes to owning a vehicle.
P = 0.68
Po = 0.6
n = 250
Zo = (P-Po)/np.sqrt(Po*(1-Po)/n)
print("Zo= {0}".format(Zo))
if Zo < 1.28:
print("We accept null hypothesis that % of citizens in city ABC that owns vehicle is 60% or less")
else:
print("We reject null hypothesis that % of citizens in city ABC that owns vehicle is more than 60%")
Zo= 2.5819888974716134 We reject null hypothesis that % of citizens in city ABC that owns vehicle is more than 60%
Q4. What is the value of the 99 percentile? 2,2,3,4,5,5,5,6,7,8,8,8,8,8,9,9,10,11,11,12
x = [2,2,3,4,5,5,5,6,7,8,8,8,8,8,9,9,10,11,11,12]
P = 99
percentile = np.percentile(x,99)
percentile
11.809999999999999
Q5. In left & right-skewed data, what is the relationship between mean, median & mode? Draw the graph to represent the same.